package
{
	public class GameTeam
	{
		public var leader:GameCreature = null;
		public var members:Array = null;
		
		public function GameTeam()
		{
			
		}
		
		public function init( c:GameCreature ):void
		{
			leader = c;
			members = new Array();
		}
		
		public function release():void
		{
			while( members.length )
			{
				members.shift();
			}
			
			members = null;
			leader = null;
		}
		
		public function join( c:GameCreature ):void
		{
			members.push( c );
		}
		
		public function leave( c:GameCreature ):void
		{
			for( var i:int = 0 ; i < members.length ; i++ )
			{
				if ( members[i] == c )
				{
					members.splice( i , 1 );
					return;
				}
			}
			
		}
		
	}
}